<template>
  <FileTreeDrawer ref="fileTreeDrawer" :download="downloadFile" :load="loadFileList" title="日志文件"/>
</template>
<script>
import FileTreeDrawer from "@/components/FileTreeDrawer";
import {downloadLogFileApi, logFileListApi} from "@/api/deploy";

export default {
  data() {
    return {
      instanceId: null,
    };
  },
  components: {FileTreeDrawer},
  methods: {
    loadFileList(dir) {
      return logFileListApi(this.instanceId, dir);
    },
    downloadFile(fileName) {
      return downloadLogFileApi(this.instanceId, fileName);
    },
    open(instanceId) {
      this.instanceId = instanceId;
      this.$refs.fileTreeDrawer.openDrawer("/");
    },

  },
};
</script>
<style scoped>
#instance-log {
  padding: 10px;
}

#instance-log /deep/ .el-drawer__body {
  overflow: auto;
}
</style>